<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/vue.js"></script>
</head>
<body>
    <div id="app">
        <h1 style="color: red;">{{ name }}</h1>
    </div>

    <template id="hello">
        <h2 style="color: green;">{{ name }}</h2>
    </template>
</body>
<script>
    var vm = new Vue({
        el: '#app',
        data: {
            name: 'aaa'
        },
        // template: '<h2 style="color: green;">{{ name }}</h2>',
       template: '#hello', // 引用模板
       render:function(createElement){
            return createElement(
                'h3',
                {
                    style:{
                        color:'blue'
                    }
                },
                this.name
            )
       }
    })

    console.log(vm.$el)
</script>
</html>